package com.j.lemon.learn.basic.file;

import java.io.*;

public class FileUtils {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("/Users/lijunjun/1.txt");
        InputStreamReader inputStreamReader = new InputStreamReader(fis);

        FileOutputStream fos = new FileOutputStream("/Users/lijunjun/222.txt");
        OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fos);
        char chars [] = new char[1024];
        int len =0;
        while((len=inputStreamReader.read(chars))!=-1){
            outputStreamWriter.write(chars,0,len);
            outputStreamWriter.flush();
        }
        fis.close();
        fos.close();
        inputStreamReader.close();
        outputStreamWriter.close();



    }
}
